﻿cmake_minimum_required(VERSION 3.4)

set(TARGET Ch12_Blur)
project(${TARGET})

add_executable(${TARGET}
    Blur.cpp
    BlurFilter.cpp
    Effects.cpp
    RenderStates.cpp
    Vertex.cpp
)

add_custom_command(TARGET ${TARGET} POST_BUILD
    COMMAND ${CMAKE_COMMAND} -E copy_directory
        ${CMAKE_CURRENT_SOURCE_DIR}/Textures
        ${CMAKE_CURRENT_BINARY_DIR}/Textures
    COMMAND ${CMAKE_COMMAND} -E make_directory
        ${CMAKE_CURRENT_BINARY_DIR}/FX
    COMMAND fxc $<$<CONFIG:Debug>:/Fc> $<$<CONFIG:Debug>:/Od> $<$<CONFIG:Debug>:/Zi> /T fx_5_0 /Fo "${CMAKE_CURRENT_BINARY_DIR}/FX/Basic.fxo" "${CMAKE_CURRENT_SOURCE_DIR}/FX/Basic.fx"
    COMMAND fxc $<$<CONFIG:Debug>:/Fc> $<$<CONFIG:Debug>:/Od> $<$<CONFIG:Debug>:/Zi> /T fx_5_0 /Fo "${CMAKE_CURRENT_BINARY_DIR}/FX/Blur.fxo" "${CMAKE_CURRENT_SOURCE_DIR}/FX/Blur.fx"
    COMMAND fxc $<$<CONFIG:Debug>:/Fc> $<$<CONFIG:Debug>:/Od> $<$<CONFIG:Debug>:/Zi> /T fx_5_0 /Fo "${CMAKE_CURRENT_BINARY_DIR}/FX/LightHelper.fxo" "${CMAKE_CURRENT_SOURCE_DIR}/FX/LightHelper.fx"
)
